package com.example.demo.mapper;

import com.example.demo.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @program: rabbit
 * @description:
 * @author: Dawson.Zhang
 * @create: 2020-05-25
 **/
public interface UserMapper {
    @Select("select * from user")
    List<User> getUsers();
    @Options(useGeneratedKeys = true,keyProperty = "id")
    @Insert("insert into user(name,address)values(#{name},#{address})")
    int addUser(User user);
}
